package main

import (
	"fmt"
	"sync"

	"example.com/singletonconfigatomic/singleton"
)

func main() {
	var wg sync.WaitGroup
	wg.Add(4)

	for i := 0; i < 4; i++ {
		go func(id int) {
			defer wg.Done()
			instance := singleton.NewServiceConfig("https://api.example.com")
			fmt.Printf("[g%d] instance=%p, ping=%s\n", id, instance, instance.Ping())
		}(i)
	}

	wg.Wait()
}
